package com.ufida.ids.model;

// Generated 2012-3-27 14:08:00 by Hibernate Tools 3.4.0.CR1

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.GenericGenerator;

/**
 * OrgModel generated by hbm2java
 */
@Entity
@Table(name = "IDS_ORG")
public class OrgModel implements java.io.Serializable {

	private Long orgId;
	private Long parentOrgId;
	private String orgCode;
	private String orgName;
	private String addr;
	private Short orgType;
	private String tel;
	private String shortname;
	private String description;
	private Short showOrder;
	private Short entityStatus;
	private String creator;
	private Date createTs;
	private String createTsStr;
	private String lastModifier;
	private Date modifiedTs;
	//private Set<StaffModel> staffModels = new HashSet<StaffModel>(0);
	private Set<PostModel> postModels = new HashSet<PostModel>(0);

	public OrgModel() {
	}

	public OrgModel(String orgName) {
		this.orgName = orgName;
	}

	public OrgModel(Long parentOrgId, String orgCode, String orgName, String addr, Short orgType, String tel,
			String shortname, String description, Short showOrder, Short entityStatus, String creator,
			Date createTs, String lastModifier, Date modifiedTs,
//			Date createTs, String lastModifier, Date modifiedTs, Set<StaffModel> staffModels,
			Set<PostModel> postModels) {
		this.parentOrgId = parentOrgId;
		this.orgCode = orgCode;
		this.orgName = orgName;
		this.addr = addr;
		this.orgType = orgType;
		this.tel = tel;
		this.shortname = shortname;
		this.description = description;
		this.showOrder = showOrder;
		this.entityStatus = entityStatus;
		this.creator = creator;
		this.createTs = createTs;
		this.lastModifier = lastModifier;
		this.modifiedTs = modifiedTs;
		//this.staffModels = staffModels;
		this.postModels = postModels;
	}

	@GenericGenerator(name = "generator", strategy = "increment")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "ORG_ID", unique = true, nullable = false, precision = 10, scale = 0)
	public Long getOrgId() {
		return this.orgId;
	}

	public void setOrgId(Long orgId) {
		this.orgId = orgId;
	}

	@Column(name = "PARENT_ORG_ID", precision = 10, scale = 0)
	public Long getParentOrgId() {
		return this.parentOrgId;
	}

	public void setParentOrgId(Long parentOrgId) {
		this.parentOrgId = parentOrgId;
	}

	@Column(name = "ORG_CODE", length = 50)
	public String getOrgCode() {
		return this.orgCode;
	}

	public void setOrgCode(String orgCode) {
		this.orgCode = orgCode;
	}

	@Column(name = "ORG_NAME", nullable = false, length = 200)
	public String getOrgName() {
		return this.orgName;
	}

	public void setOrgName(String orgName) {
		this.orgName = orgName;
	}

	@Column(name = "ADDR", length = 400)
	public String getAddr() {
		return this.addr;
	}

	public void setAddr(String addr) {
		this.addr = addr;
	}

	@Column(name = "ORG_TYPE", precision = 22, scale = 0)
	public Short getOrgType() {
		return this.orgType;
	}

	public void setOrgType(Short orgType) {
		this.orgType = orgType;
	}

	@Column(name = "TEL", length = 40)
	public String getTel() {
		return this.tel;
	}

	public void setTel(String tel) {
		this.tel = tel;
	}

	@Column(name = "SHORTNAME", length = 10)
	public String getShortname() {
		return this.shortname;
	}

	public void setShortname(String shortname) {
		this.shortname = shortname;
	}

	@Column(name = "DESCRIPTION", length = 2000)
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@Column(name = "SHOW_ORDER", precision = 22, scale = 0)
	public Short getShowOrder() {
		return this.showOrder;
	}

	public void setShowOrder(Short showOrder) {
		this.showOrder = showOrder;
	}

	@Column(name = "ENTITY_STATUS", precision = 22, scale = 0)
	public Short getEntityStatus() {
		return this.entityStatus;
	}

	public void setEntityStatus(Short entityStatus) {
		this.entityStatus = entityStatus;
	}

	@Column(name = "CREATOR", length = 20)
	public String getCreator() {
		return this.creator;
	}

	public void setCreator(String creator) {
		this.creator = creator;
	}

	@Column(name = "CREATE_TS")
	public Date getCreateTs() {
		return this.createTs;
	}

	public void setCreateTs(Date createTs) {
		this.createTs = createTs;
	}

	@Column(name = "LAST_MODIFIER", length = 20)
	public String getLastModifier() {
		return this.lastModifier;
	}

	public void setLastModifier(String lastModifier) {
		this.lastModifier = lastModifier;
	}

	@Column(name = "MODIFIED_TS")
	public Date getModifiedTs() {
		return this.modifiedTs;
	}

	public void setModifiedTs(Date modifiedTs) {
		this.modifiedTs = modifiedTs;
	}

//	@OneToMany(fetch = FetchType.LAZY, mappedBy = "orgModel")
//	public Set<StaffModel> getStaffModels() {
//		return this.staffModels;
//	}
//
//	public void setStaffModels(Set<StaffModel> staffModels) {
//		this.staffModels = staffModels;
//	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "orgModel")
	public Set<PostModel> getPostModels() {
		return this.postModels;
	}

	public void setPostModels(Set<PostModel> postModels) {
		this.postModels = postModels;
	}

	@Transient
	public String getCreateTsStr() {
		return createTsStr;
	}

	public void setCreateTsStr(String createTsStr) {
		this.createTsStr = createTsStr;
	}
}
